/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pos.util;

import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 * This the utility Class that is used for displaying messages
 * @author srikanth ramu
 */
public class DisplayMessage {

    /**
     * Display messages in the Dialog
     * @param comp
     * @param message
     * @param title
     * @param type 
     */
    public void displayMessage(JFrame comp, String message, String title, int type){
        int i = JOptionPane.showConfirmDialog(comp, message, title, type);
       if (i == JOptionPane.YES_OPTION){
           
       } else if (i == JOptionPane.NO_OPTION){
       }
    }
    /**
     * Helper method to round decimal values to 2 digits
     * @param d
     * @return 
     */
    public static double roundTwoDecimals(double d) {
        DecimalFormat twoDForm = new DecimalFormat("#.##");
        return Double.valueOf(twoDForm.format(d));
    }
}
